package com.asset.dispoal.channel.domain.db.mapper;

import com.asset.dispoal.channel.domain.db.entity.SysChannel;
import com.asset.dispoal.channel.domain.db.entity.SysChannelDebt;
import com.asset.dispoal.channel.domain.db.entity.SysChannelOpen;
import com.asset.dispoal.channel.domain.db.entity.SysChannelPay;
import com.asset.dispoal.channel.dto.SysChannelPayResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import tech.mhuang.pacebox.springboot.core.mapper.BaseMapper;
import tech.mhuang.pacebox.springboot.protocol.data.Page;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface SysChannelMapper extends BaseMapper<SysChannel, String> {

    Integer debtDelete(String id);

    Integer insertDebt(SysChannelDebt sysChannelDebt);

    Integer addTotalMoney(@Param("totalMoney") BigDecimal money,@Param("id") String channelId);

    BigDecimal getDebtMoney(String id);

    int countDebt(SysChannelDebt sysChannel);

    List<SysChannelDebt> pageDebt(Page<SysChannelDebt> page);

    String debtGetByChannelId(String id);

    Integer updateDebt(SysChannelDebt sysChannel);

    Integer openDelete(String id);

    SysChannelOpen getByOpenId(String id);

    Integer addPayMoney(@Param("payMoney") BigDecimal subtract,@Param("id") String channelId);

    Integer addOpenMoney(@Param("openMoney") BigDecimal subtract,@Param("id") String channelId);

    Integer payDeleteByOpenId(String id);

    Integer insertOpen(SysChannelOpen sysChannelDebt);

    Integer countOpen(SysChannelOpen sysChannel);

    List<SysChannelOpen> pageOpen(Page<SysChannelOpen> page);

    Integer updateOpen(SysChannelOpen sysChannelDebt);

    SysChannelPay getByPayId(String id);

    Integer payDelete(String id);

    Integer addSurplus(@Param("surplus")  BigDecimal surplus,@Param("id")  String id);

    Integer insertPay(SysChannelPay sysChannelDebt);

    List<SysChannelPayResponse> queryByOpenId(String openId);

    Integer updatePay(SysChannelPay sysChannelDebt);
}
